<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Mon, 02 May 2011 02:46:55 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>helper (Cornice)</title>

</head>
<body id="definition" onload="parent.document.title=document.title;">

<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../cornice/package-summary.html">Package</a></li>
<li class="active">Class</li>
<li><a href="../cornice/package-tree.html">Tree</a></li>
<li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../cornice\helper.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<div class="qualifiedName">cornice\helper</div>
<a href="../source/helper.php.html#line14" class="location">helper.php at line 14</a>

<h1>Class helper</h1>

<pre class="tree"><strong>helper</strong><br /></pre>

<hr>

<p class="signature">public  class <strong>helper</strong></p>

<div class="comment" id="overview_description"><p>Class contains miscellaneous utils</p></div>

<dl>
<dt>Author:</dt>
<dd>Nicola Dinh</dd>
<dt>Version:</dt>
<dd>2011.04.2217</dd>
</dl>
<hr>

<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type"> void</td>
<td class="description"><p class="name"><a href="#__construct()">__construct</a>()</p><p class="description">Default instance level constructor
Just decorative, should not be called due to having only static methods</p></td>
</tr>
<tr>
<td class="type">static  void</td>
<td class="description"><p class="name"><a href="#dump()">dump</a>(mixed object, object objecct)</p><p class="description">Dump object to file 'dump.txt'</p></td>
</tr>
<tr>
<td class="type">static  void</td>
<td class="description"><p class="name"><a href="#dump_trace()">dump_trace</a>()</p><p class="description">Dump debug backtrace</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_captcha_url()">get_captcha_url</a>()</p><p class="description">Get captcha URL</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_captcha_value()">get_captcha_value</a>()</p><p class="description">Get captcha value</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_cur_lang()">get_cur_lang</a>()</p><p class="description">Get current language in cookie</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_cur_skin()">get_cur_skin</a>()</p><p class="description">Get current skin in cookie</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_lang_url()">get_lang_url</a>(string lang)</p><p class="description">Get URL for setting language</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_local_url()">get_local_url</a>(mixed addin_path)</p><p class="description">Get the URL to a local script; this function fails if being called from 
somewhere else other than root dir of Cornice; assume not using HTTPS;
if already URL-rewritten, this functions returns the actual URL.</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_script_name()">get_script_name</a>()</p><p class="description">Get script name (ie. </p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_script_path()">get_script_path</a>()</p><p class="description">Get the path (after domain & before script file name) to requested script;
this path doesn't contain slashes at beginning & end;
this function fails if being called from somewhere else other than root
directory of Cornice.</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#get_server_name()">get_server_name</a>()</p><p class="description">Get server name (ie. </p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#make_url()">make_url</a>(string param, string param_value)</p><p class="description">Make URL with a custom param value</p></td>
</tr>
<tr>
<td class="type">static  string</td>
<td class="description"><p class="name"><a href="#trim_neat()">trim_neat</a>(string text)</p><p class="description">Trim trailing & tailing characters, also extra spaces in between</p></td>
</tr>
</table>

<h2 id="detail_method">Method Detail</h2>
<a href="../source/helper.php.html#line20" class="location">helper.php at line 20</a>

<h3 id="__construct()">__construct</h3>
<code class="signature">public  void <strong>__construct</strong>()</code>
<div class="details">
<p>Default instance level constructor
Just decorative, should not be called due to having only static methods</p></div>

<hr>

<a href="../source/helper.php.html#line56" class="location">helper.php at line 56</a>

<h3 id="dump()">dump</h3>
<code class="signature">public static  void <strong>dump</strong>(mixed object, object objecct)</code>
<div class="details">
<p>Dump object to file 'dump.txt'</p><dl>
<dt>Parameters:</dt>
<dd>objecct - The object to dump</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line66" class="location">helper.php at line 66</a>

<h3 id="dump_trace()">dump_trace</h3>
<code class="signature">public static  void <strong>dump_trace</strong>()</code>
<div class="details">
<p>Dump debug backtrace</p></div>

<hr>

<a href="../source/helper.php.html#line113" class="location">helper.php at line 113</a>

<h3 id="get_captcha_url()">get_captcha_url</h3>
<code class="signature">public static  string <strong>get_captcha_url</strong>()</code>
<div class="details">
<p>Get captcha URL</p><dl>
<dt>Returns:</dt>
<dd>The url to captcha image</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line123" class="location">helper.php at line 123</a>

<h3 id="get_captcha_value()">get_captcha_value</h3>
<code class="signature">public static  string <strong>get_captcha_value</strong>()</code>
<div class="details">
<p>Get captcha value</p><dl>
<dt>Returns:</dt>
<dd>The captcha value stored in session data</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line48" class="location">helper.php at line 48</a>

<h3 id="get_cur_lang()">get_cur_lang</h3>
<code class="signature">public static  string <strong>get_cur_lang</strong>()</code>
<div class="details">
<p>Get current language in cookie</p><dl>
<dt>Returns:</dt>
<dd>The name of language (eg. 'uk','ru',...)</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line40" class="location">helper.php at line 40</a>

<h3 id="get_cur_skin()">get_cur_skin</h3>
<code class="signature">public static  string <strong>get_cur_skin</strong>()</code>
<div class="details">
<p>Get current skin in cookie</p><dl>
<dt>Returns:</dt>
<dd>The name of skin (eg. 'sunshine')</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line105" class="location">helper.php at line 105</a>

<h3 id="get_lang_url()">get_lang_url</h3>
<code class="signature">public static  string <strong>get_lang_url</strong>(string lang)</code>
<div class="details">
<p>Get URL for setting language</p><dl>
<dt>Parameters:</dt>
<dd>lang - The language abbreviation (TLD extension)</dd>
<dt>Returns:</dt>
<dd>The relative URL with 'setlang' param</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line172" class="location">helper.php at line 172</a>

<h3 id="get_local_url()">get_local_url</h3>
<code class="signature">public static  string <strong>get_local_url</strong>(mixed addin_path)</code>
<div class="details">
<p>Get the URL to a local script; this function fails if being called from 
somewhere else other than root dir of Cornice; assume not using HTTPS;
if already URL-rewritten, this functions returns the actual URL.</p><dl>
<dt>Returns:</dt>
<dd>The URL to a local script, like being called from browser</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line143" class="location">helper.php at line 143</a>

<h3 id="get_script_name()">get_script_name</h3>
<code class="signature">public static  string <strong>get_script_name</strong>()</code>
<div class="details">
<p>Get script name (ie. the path & script file name after server name),
combines with protocol & server name will be the URL without query string.
If already URL-rewritten, this function returns the actual script file.</p><dl>
<dt>Returns:</dt>
<dd>The script path & script file name</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line156" class="location">helper.php at line 156</a>

<h3 id="get_script_path()">get_script_path</h3>
<code class="signature">public static  string <strong>get_script_path</strong>()</code>
<div class="details">
<p>Get the path (after domain & before script file name) to requested script;
this path doesn't contain slashes at beginning & end;
this function fails if being called from somewhere else other than root
directory of Cornice.</p><dl>
<dt>Returns:</dt>
<dd>The path after domain & before file name</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line132" class="location">helper.php at line 132</a>

<h3 id="get_server_name()">get_server_name</h3>
<code class="signature">public static  string <strong>get_server_name</strong>()</code>
<div class="details">
<p>Get server name (ie. 'localhost' or domain, the value configured in
Apache server config file.</p><dl>
<dt>Returns:</dt>
<dd>The server name</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line76" class="location">helper.php at line 76</a>

<h3 id="make_url()">make_url</h3>
<code class="signature">public static  string <strong>make_url</strong>(string param, string param_value)</code>
<div class="details">
<p>Make URL with a custom param value</p><dl>
<dt>Parameters:</dt>
<dd>param - The param in URL to add or replace</dd>
<dd>param_value - The value to set</dd>
<dt>Returns:</dt>
<dd>The URL with param added or replaced</dd>
</dl>
</div>

<hr>

<a href="../source/helper.php.html#line29" class="location">helper.php at line 29</a>

<h3 id="trim_neat()">trim_neat</h3>
<code class="signature">public static  string <strong>trim_neat</strong>(string text)</code>
<div class="details">
<p>Trim trailing & tailing characters, also extra spaces in between</p><dl>
<dt>Parameters:</dt>
<dd>text - The text to trim</dd>
<dt>Returns:</dt>
<dd>The trimmed text</dd>
</dl>
</div>

<hr>

<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="../cornice/package-summary.html">Package</a></li>
<li class="active">Class</li>
<li><a href="../cornice/package-tree.html">Tree</a></li>
<li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../cornice\helper.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>